package com.kob.backend.controller.user;

import com.kob.backend.service.user.UserChangeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@RestController
public class UserChangeController {
    @Autowired
    private UserChangeService userChangeService;
    @PostMapping("/user/change/")
    public Map<String,String> changeinfo(@RequestParam Map<String,String> map){
        String username=map.get("username");
        String password=map.get("password");
        String email = map.get("email");
        String phone = map.get("phone");
        String address = map.get("address");
        Integer id=Integer.parseInt(map.get("userid"));
        String flag=map.get("flag");
        return userChangeService.changeinfo(id,username,password,email,phone,address,flag);
    }
}
